package log

import (
	"os"
	"time"
)

func RunLogFile() *os.File {
	f, err := os.OpenFile(runFilename(), os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0666)
	if err != nil {
		panic(err)
	}

	return f
}

func runFilename() string {
	fileName := time.Now().Format("storage/logs/run-2006-01-02") + ".log"
	return fileName
}
